package com.jessechanrui.template.starter.weblog;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenrui
 * @date 2024/2/26
 */
//表示这个类为配置类
@Configuration
@EnableConfigurationProperties({WebLogProperties.class})
//指定参数的值符合要求，对应的配置才生效
@ConditionalOnProperty(prefix = "customize.weblog", value = "enabled", matchIfMissing = true)
public class WebLogAutoConfig {

    @Bean
    @ConditionalOnMissingBean
    public WebLogAspect webLogAspect(){
        return new WebLogAspect();
    }
}
